]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
scripting: Disable an eslint warning
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 20 Aug 2019 00:36:36 +0000 (02:36 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 15 Sep 2019 14:02:45 +0000 (16:02 +0200)
Calling await in a loop means the asynchronous operations are
run sequentially instead of in-parallel. Usually that's not
what's wanted, so eslint has a rule to warn about this.

However here we use async/await to handle control back to the
mainloop between steps, so running operations sequentially is
actually intended.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731

js/ui/scripting.js

index 7a14fcf551c1781aa9167a3625cd1768ffe8008c..84c1ad183e94722f5a4c7e4a9fb9d08946e44fa8 100644 (file)
@@ -317,7 +317,7 @@ async function runPerfScript(scriptModule, outputFile) {
 
     for (let step of scriptModule.run()) {
         try {
-            await step;
+            await step; // eslint-disable-line no-await-in-loop
         } catch (err) {
             log(`Script failed: ${err}\n${err.stack}`);
             Meta.exit(Meta.ExitCode.ERROR);